package com.smw.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Date;

@Data
@TableName("user")
@Validated
public class User {
    //@Value("张江林")
    //@Null(message="必须是空")
    //@NotNull(message = "不能是空")
   // @NotBlank(message = "不能为空，空字符串也不行")
    private Integer id;
    @Size(min = 5,max = 5 )
    @Pattern(regexp ="/^[A-Z][a-z][0-9][0-9][0-9]*$/")
    private String userName;
    //@Value("22")
    //@Max(value = 20)
    //@Range(min = 10,max = 20 )
    //@Pattern(regexp ="^[0-9]*$")

    private Date birth;
    @Size(min = 6,max = 9 )
    @Pattern(regexp ="[%@#\\^]+")
    private String passWord;
    @Pattern(regexp ="[1-9]\\d{7,10}@qq\\.com")
    private String email;
    private String emailCode;



}
